import request from '@/utils/request'

// 获取短信验证码
export function getSmsCode(phone) {
  return request({
    url: '/user/sms',
    method: 'post',
    data: { phone }
  })
}

// 手机号验证码登录
export function loginBySms(data) {
  return request({
    url: '/evox-drama/auth/login',
    method: 'post',
    data
  })
}

// 手机号验证码登录
export function loginByPassword(data) {
  return request({
    url: '/evox-drama/auth/password-login',
    method: 'post',
    data
  })
}

// 退出登录
export function logout() {
  return request({
    url: '/evox-drama/auth/logout',
    method: 'post'
  })
}

// 获取用户信息
export function getUserInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

// 根据用户ID获取用户信息
export function getUserInfoById(userId) {
  return request({
    url: `/evox-drama/user/${userId}`,
    method: 'get'
  })
} 